<template>
	<view class="item" @click="goArticle">
		<view class="title text-ellipsis">{{articleItem.title}}</view>
		<view class="content flex-row">
			<view class="info">
				<view class="summary">
					<span>文章类别：{{articleItem.articleLabel}}</span>
					<br>
					<span>作者：{{articleItem.author}}</span>
				</view>
				<view class="flex-row">
					<text class="date">发布时间：{{articleItem.sendTime}}</text>
					<text class="views">阅读：{{articleItem.see}}</text>
				</view>
			</view>
			<view class="cover">
				<image class="img" :src="BASE_IMG + articleItem.img" mode="aspectFill"></image>
			</view>
		</view>
	</view>
</template>

<script setup>
import { defineProps } from 'vue';
import {BASE_IMG} from "@/utils/imgComBaseUrl.js"

// 定义 props
const props = defineProps({
  articleItem: {},
});
function goArticle(){
	uni.navigateTo({
		url:'/pages/article-details/article-details?id='+ props.articleItem.id
	})
}
</script>

<style lang="scss" scoped>
.item{
	padding: 30rpx;
	margin-bottom: 30rpx;
	background-color: #f7fbfc;
	
	.title{
		font-weight: bold;
		padding-bottom: 30rpx;
		border-bottom: 2rpx solid #F5F5F5;
	}
	
	.content{
		padding-top: 30rpx;
		align-items: flex-start;
		justify-content: space-between;
		display: flex;
		.info{
			width: calc(100% - 160rpx);
			
			.flex-row{
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: space-between;
			}
			.summary{
				color: #777;
				height: 80rpx;
				font-size: 24rpx;
				line-height: 1.6;
				margin-bottom: 10rpx;
			
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}
			
			.date{
				font-size: 24rpx;
				color: #FF5500;
				opacity: 0.6;
			}
			
			.views{
				color: #999;
				font-size: 24rpx;
			}
		}
		
		.cover{
			width: 140rpx;
			height: 120rpx;
			
			.img{
				width: 100%;
				height: 100%;
	
				
				border-radius: 10rpx;
			}
		}
	}
}
</style>
